import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'timeFormat'
})
export class TimeFormatPipe implements PipeTransform {

  transform(time: number): string {
    if (time) {
      const temp = time | 0;
      const minutes = (temp / 60 | 0).toString().padStart(2, '0');
      const seconds = (temp % 60).toString().padStart(2, '0');

      return `${minutes}:${seconds}`;
    }
    return '00:00';
  }

}
